Personal video recorders, set-top boxes, personal computers, etc. typically employ various memory devices to store program and system information. Memory devices include hard disk drives, recordable disks, semiconductor memory devices and the like. Set-top boxes, for example, require a sufficient time to provide orderly shutdown such that data can be saved in a non-volatile memory such as Flash memory device before the supply voltage drops to such a low level that saving the data can no longer be accomplished.
AC power sources that power such devices can suffer from a variety of long-term and transient disturbances or power fail conditions. The term “power disturbance” or “power fail condition”, as used herein, refers to a condition in which a magnitude of an AC input supply voltage is smaller than required to be within a normal range of values, a condition that might necessitate performing an orderly shutdown of the device.
In order to guarantee the necessary time for the orderly shutdown, a voltage that is indicative of the AC mains supply voltage is monitored. An early power fail (EPF) threshold voltage is chosen such that the magnitude of the AC mains supply voltage is higher than a minimum required to operate direct current (DC) power supplies in, for example, the set-top box. The set-top box DC power supplies have to remain active long enough after EPF threshold voltage is detected to enable sufficient time for performing orderly shutdown.
It might also be desirable to allow uninterrupted operation, during brown out conditions, when the AC voltage is too small to be within the normal tolerance or range but is greater than what the set-top box actually needs for uninterrupted normal operation.
In a prior art arrangement, a threshold detector provides an output signal indicating that the AC mains supply voltage has exceeded, during a portion of a given period of the AC mains supply voltage, a threshold magnitude. This situation is considered to be an undisturbed AC mains supply voltage. Conversely, the detector output signal would indicate a disturbance or power failure in the AC mains supply voltage, when the AC mains supply voltage exceeds the threshold magnitude, at no time throughout the entire period.
Typically an electrolytic capacitor is used to maintain sufficient amount of stored charge for use between the time the EPF threshold is detected and the time when the orderly shutdown is completed. Because of conditions such as tolerances, variation in thresholds due to loading, etc., either the EPF threshold voltage has to be set higher or a larger value electrolytic capacitor value has to be chosen than would be, otherwise, necessary. This has to be done so that orderly shutdown can be guaranteed under all such conditions.
In the prior art arrangement, there is a range of values of the AC mains supply voltage that will exceed, during a portion of a given period of the AC mains supply voltage, the threshold magnitude. Because the actual magnitude of the AC mains supply voltage is not measured, the threshold magnitude has to be set in a manner to meet the worst case condition. Consequently, the threshold magnitude has to be set, disadvantageously, at a higher value than if the actual magnitude of the AC mains supply voltage was measured and known. This requires the initiation of the shutdown routine when the magnitude of the AC mains supply voltage is, disadvantageously, higher than if the actual magnitude of the AC mains supply voltage was measured and known.
An EPF detection circuit, embodying an aspect of the invention, applies a rectified periodic waveform that is unfiltered with respect to the frequency of the AC mains supply voltage to a threshold detector. In contrast to the prior art, both when the magnitude (for example, RMS or peak) of the AC mains supply voltage is at an acceptable magnitude and also when a disturbance occurs, the inventive detector detects, during each period, a time when the increasing waveform crosses a threshold magnitude in a first direction and a time when the decreasing waveform crosses a threshold level in an opposite direction. A time measuring device, for example, a microprocessor, measures a length of an interval between threshold crossing times; alternatively, it calculates a duty cycle of an output signal of the threshold detector. Each of those results is indirectly indicative of a magnitude (for example, RMS or peak) of the mains supply voltage. A larger duty cycle or a longer length would be indicative of a higher magnitude and vice versa. Based on the result of the indirectly measured magnitude, the microprocessor can initiate and perform orderly controlled power shutdown of the apparatus by, for example, program interrupt routine. Because of the indirect measurement of the actual magnitude (for example, RMS or peak) of the AC mains supply voltage, the threshold magnitude for shutdown can be established at, advantageously, a lower magnitude of the AC mains supply voltage than required in the prior art. By accurately indirectly monitoring the magnitude of the AC mains supply voltage, the set-top box can continue uninterrupted operation with, advantageously, lower magnitudes of AC mains than would be required in the prior art power supply prior to initiating shutdown. It will also provide the flexibility to operate, for example, the set-top box during, advantageously, longer intervals of AC dropout, during which the disturbance occurs in only a limited number of periods of the AC mains supply voltage.